package com.zipking.cloud.springbootmybatis.persistance.entity;


import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.zipking.cloud.springbootmybatis.vo.MenuVo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 
 * </p>
 *
 * @author kingbird
 * @since 2024-08-29
 */
@TableName("t_menu")
public class TMenu extends Model<TMenu> {

    private static final long serialVersionUID = 1L;

    private Integer id;
    private String name;
    private Integer pid;
    private Integer rank;


    public Integer getId() {
        return id;
    }

    public TMenu setId(Integer id) {
        this.id = id;
        return this;
    }

    public String getName() {
        return name;
    }

    public TMenu setName(String name) {
        this.name = name;
        return this;
    }

    public Integer getPid() {
        return pid;
    }

    public TMenu setPid(Integer pid) {
        this.pid = pid;
        return this;
    }

    public Integer getRank() {
        return rank;
    }

    public TMenu setRank(Integer rank) {
        this.rank = rank;
        return this;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "TMenu{" +
        ", id=" + id +
        ", name=" + name +
        ", pid=" + pid +
        ", rank=" + rank +
        "}";
    }
    @TableField(exist = false)
    private List<TMenu> children=new ArrayList<>();

    public List<TMenu> getChildren() {
        return children;
    }

    public void setChildren(List<TMenu> children) {
        this.children = children;
    }
}
